Now that we have a new API to get all the windows and metaWindows from
our layout manager, implement the deleteAll() method of the window clone
using that API instead of looping through the children of the actor and
using the source of the ClutterClone.
https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1298
}
deleteAll() {
+ const windows = this.layout_manager.getWindows();
+
// Delete all windows, starting from the bottom-most (most-modal) one
- let windows = this.get_children();
- for (let i = windows.length - 1; i >= 1; i--) {
- let realWindow = windows[i].source;
- let metaWindow = realWindow.meta_window;
+ for (const window of windows.reverse()) {
+ const metaWindow = this.layout_manager.getMetaWindow(window);
metaWindow.delete(global.get_current_time());
}
- this.metaWindow.delete(global.get_current_time());
this._closeRequested = true;
}